<%@ page pageEncoding='UTF-8'%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:set var="contextPath" value="#request.get('javax.servlet.forward.context_path')" scope="request" />
<!DOCTYPE html>
<head>
    <title>Edit Login Details</title>
    <%-- header --%>
    <jsp:include page="/WEB-INF/content/common/Header.jsp" flush="true"/>
    <%--<script src="${contextPath}/js/jquery/jquery.validate.js"></script>--%>
    <script src="${contextPath}/js/common/user.js"></script>
</head>
<body class="metro lists">
	<%-- tob-bar --%>
    <jsp:include page="/WEB-INF/content/common/TopBar.jsp" flush="true"/>
       	
	<div id="main-container" class="body-wrapper">
        <%-- tob-container --%>
    	<jsp:include page="/WEB-INF/content/common/TopContainer.jsp" flush="true"/>
        
    	<div id="body-container"> 
               <div id="user-info-container">
                	<h1>
                    	<s:set var="urlUserType" value="'patient'"/>
                        <s:if test="%{guiUserLogin.user.type == 'DOCTOR'}">
							<s:set var="urlUserType" value="'doctor'"/>
						</s:if>
                        <s:elseif test="%{guiUserLogin.user.type == 'ASSISTANT'}">
                        	<s:set var="urlUserType" value="'assistant'"/>
                        </s:elseif>
                    	<a href="${contextPath}/${urlUserType}/show?id=${guiUserLogin.user.userId}">
                        	<i class="icon-arrow-left-3 fg-darker smaller"></i>
                        </a>
                    	Hi,
                        <small class="on-right">${guiUserLogin.user.name}</small>
                	</h1>         
                </div>
                
                <div id="userlogin-edit-form-container" class="form-container">
                    <form id="userlogin-edit-form" class="edit-form userlogin-edit-form place-right" action="${contextPath}/userlogin/update" method="post">
                        <input type="hidden" name="guiUserLogin.user.userId" value="${guiUserLogin.user.userId}" />
                        <input type="hidden" name="guiUserLogin.loginId" value="${guiUserLogin.loginId}" />
                        <fieldset>
                            <legend>Update User Login</legend>
                            <div class="action-error-container">
                                <s:if test="hasActionErrors()">
                                    <s:actionerror/>
                                </s:if>
                            </div>
                            <label>Username<em class="text-alert">*</em></label>
                            <div class="input-control text">
                                <input type="text" name="guiUserLogin.username" value="${guiUserLogin.username}" placeholder="input text" required/>
                                <button class="btn-clear"></button>
                            </div>
                            <label>Old Password</label>
                            <div class="input-control password">
                                <input type="password" name="guiUserLogin.oldPassword" value="" placeholder="old password" id="oldLoginPassword"/>
                                <button class="btn-reveal"></button>
                            </div>
                            <label>New Password<em class="text-alert">*</em></label>
                            <div class="input-control password">
                                <input type="password" name="guiUserLogin.password" value="" placeholder="new password" id="loginPassword"/>
                                <button class="btn-reveal"></button>
                            </div>
                            <label>Confirm Password<em class="text-alert">*</em></label>
                            <div class="input-control password">
                                <input type="password" name="guiUserLogin.confirmPassword" value="" placeholder="confirm password" id="confirmLoginPassword"/>
                                <button class="btn-reveal"></button>
                            </div>
                            <div class="form-button-container">
								<!--<a onClick="$('.userlogin-form').submit(); return false;">
                                    <div class="form-button tile half-vertical subheader-secondary bg-cobalt fg-white">
                                        Update <i class="icon-pencil on-right smaller"></i>
                                    </div>
                            	</a> 
								<a href="${contextPath}">
		                          	<div class="form-button tile half-vertical subheader-secondary bg-cyan fg-white">
		                            	cancel <i class="icon-cancel-2 on-right smaller"></i>
		                           	</div>
								</a> -->
	                       </div>
                           <div>
                            <input type="submit" value="Update" class="primary" />
                            <a href="${contextPath}" class="button info">Cancel</a>                                 
                           </div>
                        </fieldset>
                    </form>
    			</div>    
    	</div>
        
        <%-- bottom-container --%>
    	<jsp:include page="/WEB-INF/content/common/BottomContainer.jsp" flush="true"/>
        
	</div>
    
    <%-- footer-container --%>
    <jsp:include page="/WEB-INF/content/common/FooterContainer.jsp" flush="true"/>
    
</body>
</html>